#include "BreatheGame.h"


BreatheGame::BreatheGame(void)
{
	fadeTimer.restart();
	positiveFade = false;
}


BreatheGame::~BreatheGame(void)
{
}

void BreatheGame::draw()
{
	if(clientPlaying)
	{
		if (positiveFade)
		{
			npc->drawMessage("Breathe in...");
		}
		else
		{
			npc->drawMessage("Breathe out...");
		}
		clouds->drawClouds(window);
	}
}

void BreatheGame::mousePressed(sf::Vector2f loc)
{
	
}

void BreatheGame::performLogic()
{
	if(clientPlaying)
	{
		sf::Time elapsedTime = fadeTimer.getElapsedTime();
		if (elapsedTime.asSeconds() >= 3)
		{
			int trans = 3;
			sf::Color target = sf::Color::White;
			if (positiveFade)
			{
				target = sf::Color::Black;
			}
			window->getBackground()->transition(trans, target);
			fadeTimer.restart();
			positiveFade = !positiveFade;
			monster->hit(5, false);
		}
	}
}
